/**
 * @description: 管理员权限接口参数校验
 * @version: 0.0.1
 * @author: z..
 * @Date: 2023-06-08 14:07:35
 */

import { Rule, RuleType } from '@midwayjs/validate';
import { requiredNumber, requiredString, PageDTO } from "./common";

// 分页查询
export class AdminWorkingPageDTO extends PageDTO {
  @Rule(RuleType.any())
  deptId: any;
}
// 下载文件
export class DownloadAdminWorkingFileDTO {
  @Rule(RuleType.any())
  searchKey: any;
  @Rule(RuleType.any())
  deptId: any;
  @Rule(RuleType.any())
  startTime: any;
  @Rule(RuleType.any())
  endTime: any;
}
// 更新
export class UpdateJsonConfigDataDTO{
  @Rule(requiredString)
  jsonData: string;
  @Rule(requiredNumber)
  id: number;
}
// 新增
export class InsertJsonConfigDataDTO{
  @Rule(requiredString)
  jsonData: string;
  @Rule(requiredString)
  jsonName: string;
  @Rule(requiredString)
  jsonCode: string;
}


export enum KeyType {
  user = 'user',
  project = 'project',
}

//工时汇总图表查询
export class ChartsDataDTO{
  @Rule(requiredString)
  startTime: string;
  @Rule(requiredString)
  endTime: string;
  @Rule(RuleType.string().valid(...Object.values(KeyType)))
  type: string;
  @Rule(RuleType.any())
  deptId: any;
}